/*3、题目：设计实现地址功能的类，要求具有的属性：省、市、街道、门牌号、邮编；具有能设置和获取属性的方法。*/

package demo;
 class Address {
    private String province;//省
    private String city;//市
    private String street;//街道
    private int  houseNumber;//门牌号
    private int postcode;//邮政编码

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public int getHouseNumber() {
        return houseNumber;
    }

    public void setHouseNumber(int houseNumber) {
        this.houseNumber = houseNumber;
    }

    public int getPostcode() {
        return postcode;
    }

    public void setPostcode(int postcode) {
        this.postcode = postcode;
    }

     @Override
     public String toString() {
         return "Address{" +
                 "province='" + province + '\'' +
                 ", city='" + city + '\'' +
                 ", street='" + street + '\'' +
                 ", houseNumber=" + houseNumber +
                 ", postcode=" + postcode +
                 '}';
     }
 }
public class Test{
    public static void main(String[] args) {
        Address address=new Address();
        address.setProvince("陕西省");
        address.setCity("西安市");
        address.setStreet("未央湖街道");
        address.setHouseNumber(88888);
        address.setPostcode(545584);
        System.out.println(address.toString());
    }
}
